package Main;

import FileProcess.JsonRead;
import Lucene.LineIndexMaker;

public class Main_doIndex 
{
	public static void main(String[] args) 
	{
		if(args.length != 4)
		{
			System.out.println("Error, you should input four argument - " +
					"<file path of text.json> <file path of product.json>\n <dir path of storing each article>" +
					"<dir path of building index>");
		}
		else
		{
			JsonRead r = new JsonRead(args[2]);
			//load data
			r.ACT002_readJson(args[1], "Product");
			//generate index list
			LineIndexMaker IM = new LineIndexMaker();
            System.out.println("Create index file");
			IM.ACT001_doIndex(args[2]+"products", args[3]);
		}
	}

}
